package com.example.blog.mapper;

import com.example.blog.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
/**
 * 登录
 * @return userInfo(通过id进行查询,通过userName进行查询)
 */
    //id
    @Select("select id, user_name,github_url from `user` where id=#{id} and delete_flag=0")
    UserInfo getInfoById(@Param("id") Integer id);

    //userName
    @Select("select id, user_name,password, github_url,delete_flag,create_time,update_time from `user` where user_name=#{userName} and delete_flag =0")
    UserInfo loginInfoByUserName(@Param("userName") String userName);

    //注册
//    @Insert("insert into user(user_Name,password) ")
//    Integer insertUserInfo(UserInfo userInfo);
}
